#include "WindowHandler.h"
#include "StateManager.h"
#include "Utility.h"

const int screenSizeX = 1920; const int screenSizeY = 1080;
const int width = 400; const int height = 400;
std::string title = "Platformer";
const int xPos = (screenSizeX - width)/2; const int yPos = (screenSizeY - height)/2; // Moves the window to the center of the screen.
const double fps = 120.0f;

int main(){
	WindowHandler windowHandler = WindowHandler();
	windowHandler.initialize();
	windowHandler.openWindow(width, height, title, xPos, yPos);
	StateManager stateManager = StateManager();
	stateManager.initialize(STATE_INTRO);
	while(windowHandler.isOpened()){
		stateManager.runCurrentState();
		windowHandler.swapBuffers();
		capFrameRate(fps);
	}
	stateManager.cleanup();
	windowHandler.closeWindow();
	windowHandler.cleanup();
	return 0;
}